package com.atguigu.gulimall.product.feign;

import com.atguigu.common.to.es.SkuEsModel;
import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
@FeignClient(value = "gulimall-search")
public interface SearchFeignService {

    //feign.FeignException$NotFound: [404] during [POST] to [http://gulimall-ware/ware/waresku/hasStoc] [WareFeignService#getSkuHasStock(List)]:
    // [{"timestamp":"2023-04-03 16:29:15","status":404,"error":"Not Found","path":"/ware/waresku/hasStoc"}]
    //feign.FeignException$NotFound: [404] during [POST] to [http://gulimall-search/search/save/product] [SearchFeignService#productStatusUp(List)]:
    // [<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} ... (431 bytes)]

    // /search/save/product
    @PostMapping(value = "/search/save/product")
    R productStatusUp(@RequestBody List<SkuEsModel> skuEsModels);
}


